package com.example.chatroom.dto;


import com.example.chatroom.domain.ChatHistory;
import com.fasterxml.jackson.annotation.JsonFormat;

import java.sql.Timestamp;

public class HistoryMessageDTO {

    private String fromNickname;

    private String toNickname;

    private String content;

    private String emotion;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Timestamp date;

    public HistoryMessageDTO(String fromNickname, String toNickname, ChatHistory chatHistory) {
        this.fromNickname = fromNickname;
        this.toNickname = toNickname;
        this.content = chatHistory.getContent();
        this.emotion = chatHistory.getEmotion();
        this.date = chatHistory.getDate();
    }

    public String getFromNickname() {
        return fromNickname;
    }

    public String getToNickname() {
        return toNickname;
    }

    public String getContent() {
        return content;
    }

    public String getEmotion() {
        return emotion;
    }

    public Timestamp getDate() {
        return date;
    }
}
